package com.blog.controller.admincategory;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.blog.controller.base.BaseServlet;
import com.blog.service.admincategory.AdminCategoryService;

@WebServlet("/adminAjaxTypes")
public class AdminAjaxTypesServlet extends BaseServlet {

	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
	}

	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		String value = req.getParameter("newvalue");
		String id = req.getParameter("id");
		//System.out.println(value);
		if(value!=null&&id!=null) {
			int typesid = Integer.parseInt(id);
			AdminCategoryService service = new AdminCategoryService();
			service.updateTyeps(value,typesid);
			resp.getWriter().println("修改成功！");
		}
		
	}
}

